{{left_sidebar_enabled,right_sidebar_enabled=False,False}}
{{extend 'layout.html'}}

{{=H3('Funções', _style='text-align:left')}}
{{r_list = []}}
{{for f in funcoes_tbody:}}
	{{r = TR(*[TD(f[i], _style='text-align:center') for i in xrange(len(f)-1)])}}
	{{r.append(A('editar', _href=URL('update_funcao', args=f[len(f)-1])))}}
	{{r.append(A('apagar', _href=URL('delete_funcao', args=f[len(f)-1])))}}
	{{r_list.append(r)}}
{{pass}}
{{=TABLE(
	THEAD(TR(*[TH(*i, _style='text-align:center; width:90px;') for i in funcoes_thead])),
	TBODY(*r_list),
	TFOOT(
		TR(TD(B('Total', _style='font-weight: bold'), _style='text-align:left'),
			*[TD(s, _style='text-align:center') for s in funcoes_sum], _style='border-top:1px solid #503f7f'),
		TR(TD('Taxa', _style='font-weight:bold'),
			*([TD(s, _style='text-align:center') for s in funcoes_taxa[:len(funcoes_taxa)-1]] +
				[TD(funcoes_taxa[len(funcoes_taxa)-1], _style='text-align:center'), TD('')] +
				[TD(A('editar', _href=URL('update_taxa')))]), _style='border-top:1px solid #503f7f'),
		TR(TD(B('Custo', _style='font-weight: bold'), _style='text-align:left'),
			*[TD(s, _style='text-align:center') for s in funcoes_custo], _style='border-top:1px solid #503f7f'),
	))}}

{{=A('Adicionar Função', _href=URL('new'), _class='button')}}
